import { App } from 'vue';
import {
  ElContainer,
  ElRow,
  ElCol,
  ElButton,
  ElIcon,
  ElLoading,
  ElTooltip,
  ElTag,
} from 'element-plus';

import {
  SvgIcon,
  FaIcon,
} from '@/components';

const aComponents: any[] = [
  ElContainer,
  ElRow,
  ElCol,
  ElButton,
  ElIcon,
  ElTooltip,
  ElTag,

  SvgIcon,
  FaIcon,
];

const aMethods: any[] = [
  ElLoading,
];

const bootstrapElement = {
  install: (app: App) => {
    /**
     * app.component(ElButton.name, ElButton)
     * app.use(ElMessage)
     */
    aMethods.forEach(item => {
      app.use(item);
    });
    aComponents.forEach(item => {
      app.component(item.name, item);
    });
    // console.log(app.config.globalProperties);
  },
};

export default bootstrapElement;
